<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="parent">
        <div id="good">good</div>
        <div id="bad">bad</div>
    </div>
    <script>
        /* 增，删，改，查 */
        var parent=document.getElementById("parent")
        var good=document.getElementById("good");
        var bad=document.getElementById("bad");
        var p=document.createElement("p")
        p.innerHTML="hello world";
        /* 
        appendChild
        给元素增加节点   往后面增加
        */
        parent.appendChild(p);   //good   bad   hello world
        /* 
        removeChild() 从DOM树上移除一个元素
         */
         parent.removeChild(good);   // bad    hello world
    </script>
</body>
</html>